static added to constants.
Fix a few bugs.