Added platform checks
Minor bug fix