More tests and code ported. Better exception handling.