Added changes asked by timgraham and jorgecarleitao

- Fixed some coding style issues
- Fixed link errors in documentation
- Improved regression tests