Fixed logic so size is actually handled sanely