Removing some magic numbers, correcting a bit