Re-add changes from original preparegui
Merge fixed develop