Fix function return values
Remove unused method
Fix compilation, added maven build