Patch fixes, thanks @robhudson!