Made the size hack better
Some small bug fixing