Added license and copyright; bugfix