Added more checks for malformed package versions