Bug fixes to prevent application lockup