added move support and fixed a few edge cases