Fix miscellaneous errors