Messy: Make it work for Mathspace
Merge branch 'various-fixes'