Fixed selection bug and added preservemode option