Make sure the $DefaultCompany variable is always set
Fixes issues with Insert/Update buttons
Fix sql error
Merge pull request #554 from timschofield/develop

Develop