Rewritten parameter binding code. This fixes the problem with additional spaces as well as the one with corrupted binary data.