Fixed several issues
merge of bkgf latest edits; some duplication