Bugfix/initial resize support

New PR, after rebasing off of 0.5.0+1.