Bug fixes

thanks to aya :)