Fixed an issue with serializing the "environment" property.

- Renamed the method get/setEnvironmentName to simply get/setEnvironment.
- Added a missing quote in the error message when a getter could not be
  found.