Fixes for better perfomance.