Fixed #23

Fixed NullPointerException