Miscellaneous small fixes