Fixed bug mentioned by Tawfiq, I think