Miscellanous fixes