Fixed a few compilation errors and a problem with constants.
Update