File path bug fixes and more database stuff