Fixes a bug where updateapp fails to complete.

This works for me but could be exposing another bug or removing an intended feature. Needs review.