Documented connection errors with Javadoc syntax
Added some TODO
Some code restyling