Finishing bug fixes