ruby 1.9 compatible case statements
small bug fixes