bug fixes for synthesis