Polishes Java code
Improves exceptions, by at least logging them