Fix use of magic numbers as identified in checkstyle
Fix visibility issues, and turn on checkstyle check for that.