BUG: Fixed database writing bug introduced with recent GUI enhancements