Issues/san 281 ui crash

Please don't be confused by the reformatting commit. Main fix was on the commit 535557a and 5a9e38c.