Fixes on server and cleanup-buffer