Fixed #246 on master

#246