Adding resize option, some minor bugfixes