Adding test for bug #5656 (cherry picked from commit 12b62e3)
Fixing annotations (cherry picked from commit 1c109e4)
Fixing bug #5656 (cherry picked from commit afa5399)