Applied Jose's fix.

Fixed #497