Adjusted code style, throw for non-int file modes.