Fix properties population when prototype selected and order them by position rather then alphabetically.

Fixes #2389