Fixed Macros and cleaned up osd_read()