Fixed compilation failures caused by conflicts with Boost.Range.

Added names to some enum types to avoid compilation failures with gcc 4.4 caused by operators defined by Boost.Range in namespace boost. The operators fail to compile because they attempt to instantiate a template with the anonymous enum type in its parameters.

Additionally, added explicit type casts to the enum values to avoid any further possible ambiguities.