Pull request for 3.1.8-GA

Hi this is Daniel Locious from the forum; I am learning to contribute to the open source project. I found a few issues which I think I can fix.

I'll first fork the master, then play with it.

Question: do I need to create an issue in github (for tracking purpose) before I start to fix the bug?