Fixed pointer bug and bitrate bug. Can be merged soon