Improved documentation and added control over global options