Fixes and new features. Changed the licence