Fixed bug for undefined axis