Cleaned up magic constants. Better handling of missing parameters for controllers.