Add debug target, remove cast, note possible bug.