Added some debugging information.
Added checks for values, after alignment, to be 0 instead of negative.