Both errors still exist as of 5.2.0 Release and commit 407acc04a93f09ecb42c07c98b74fd00cc967100.
But thanks for the fixes, it took a while before I found this thread and I now have 5.2.0 release working.
I choose to rename the local variable (Ctrl-R-R is such a beautiful thing).