Fixed bug

Fixed bug: The read function shall be called only when the
Next bit position is < previous bit position. Also fixed the build
error.
Resolved Merge Conflict

Resolved merge conflict in server.c