Some modifications, fixes #2