Fix sprite bounds checking