Some fixes for out of range data