Fix #18. Rework form loading logic to avoid crash