Added proper management of bounds and wrapping