Issues 372 and 316 with changes

I made the changes for these issues and hopefully removed the temporary files this time. Is everything looking better now?