Minor scalafication
Better error reporting
Initial backgorund elimination