Fixed #803 thanks to @ninjalulz