Fixed errors (thanks to linonel-m)