Fix adjust size function