Bug fixes as ordering is mixed up