Fixed bug #887
Replaced tabs with spaces.
Switched to using proper enums as opposed to ints.
cleanup