Replaced static objects with #defines and panic checking