Fixes potential bugs.