Fixed exception handling.
Added more stubs.