Fixes and improved documentation