Fixes bugs, warnings.