Fixed some bugs plus updated to current draft compression spec.