Fixed panning, added in debug messages