Feature #4977: Fix some issues