Fix nullpointerexceptions

Fixed exceptions caused by mouseReleased method in the ShapeMouseHandler