bug fixes and escape additions