Minor fixes
Fewer magic numbers