Fixing issues discovered by @manuakasam - thanks\!