Fixes some compile warnings, unused variables and size_t
optimized normalized position for common cases where it does not need to be recalculated.