Fix BAR access

Fix BAR access and I/O buffers