fix cgcolor check and add default for border width