Bug fixes to minimize error logs