Fix Redmine bugs 504, 459